package ZipList;

public class Main {
    public static void main(String[] args) {
        ZipList ziplist = new ZipList(2);

        // 插入几个元素
        ziplist.insert("Hello".getBytes());
        ziplist.insert("World".getBytes());
        ziplist.insert("This is a ziplist".getBytes());

        // 根据索引找到对应元素
        ZipListEntry entry = ziplist.find(0);
        System.out.println("First entry data: " + new String(entry.getData()));

        // 获取全部数据
        ZipListEntry[] allData = ziplist.getAllData();
        for (ZipListEntry data : allData) {
            System.out.println("Data: " + new String(data.getData()));
        }
    }
}
